package com.hk.hkessian;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.remoting.caucho.HessianServiceExporter;
import org.springframework.stereotype.Component;

import com.hk.service.order.IPayment;

@Component
public class SimpleHessian {

	@Autowired
	private IHelloService helloService;
	@Autowired
	private IPayment paymentService;

	@Bean(name = "/helloService")
	public HessianServiceExporter hessianServiceExporter() {
		HessianServiceExporter export = new HessianServiceExporter();
		export.setService(helloService);
		export.setServiceInterface(IHelloService.class);
		return export;
	}

	@Bean(name = "/helloPaymentService")
	public HessianServiceExporter helloPaymentService() {
		HessianServiceExporter export = new HessianServiceExporter();
		export.setService(paymentService);
		export.setServiceInterface(IPayment.class);
		return export;
	}

}
